import request from '@/utils/request'

// 查询DEMO用户信息列表
export function getSatelliteListSerive(currentPage, pageSize) {
    return request({
        url: '/apis/satelliteList0',
        method: 'get',
        params: {
            currentPage: currentPage,
            pageSize: pageSize
        },
    })
}
export function canProtocolListSerive(currentPage, pageSize) {
    return request({
        url: '/apis/canProtocolList0',
        method: 'get',
        params: {
            currentPage: currentPage,
            pageSize: pageSize
        },
    })
}

export function InstructTypesSerive(params) {
    return request({
        url: '/apis/InstructTypes0',
        method: 'get',
        params: params,
    })
}

export function getInstructionsOfTypeSerive(params) {
    return request({
        url: '/apis/getInstructionsOfType0',
        method: 'get',
        params: params,
    })
}

/* 根据关键词拿搜索列表 */
export function getSearchList(keyword) {
    return request({
        url: '/apis/getInstructionsBySouSuo/search/suggest',
        method: 'get',
        params: keyword,
    }).then(res => res.data) // 约定返回数组[{id,title},...]
}

/**
 * 批量删除 待发指令
 * @param params
 * @returns {*}
 */
export function deleteInstructsSerive(params) {
    return request({
        url: '/apis/satellite/KmxReadyCommand/deleteAll',
        method: 'delete',
        data: params,
    })
}
/* 根据id拿详情 */
export function getDetail(id) {
    return request({
        url: `/apis/search/detail/${id}`,
        method: 'get'
    }).then(res => res.data) // 约定返回对象
}
export function getInstructionsBySouSuoTypeSerive(params) {
    return request({
        url: '/apis/getInstructionsBySouSuo',
        method: 'get',
        params: params,
    })
}
export function ShengChengZhiLingCodeSerive(params) {
    return request({
        url: '/apis/aos/ShengChengZhiLingCode',
        method: 'post',
        data: params,
    })
}

export function getInstructionParametersSerive(params) {
    return request({
        url: '/apis/getInstructionParameters',
        method: 'get',
        params: params,
    })
}

export function saveInstructionParametersSerive(params) {
    return request({
        url: '/apis/saveInstructionParameters',
        method: 'post',
        data: params,
    })
}
// 多星发送指令
export function duoxingFaSongZhiLingSerive(params) {
    return request({
        url: '/apis/aos/duoxingFaSongZhiLing',
        method: 'post',
        data: params,
    })
}

// 多星发送指令
export function shanChuZhunBeiZhiLingSerive(ids,id) {
    return request({
        url: `/apis/satellite/KmxReadyCommand/`+id,
        method: 'delete',
        data: ids,
    })
}
// 多星发送指令
export function chaXunYiFaSongZhiLingSerive(params) {
    return request({
        url: '/apis/command/chaXunYiFaSongZhiLing',
        method: 'get',
        params: params,
    })
}

/**
 * 查询准备发送指令：前端页面主要展示对象列表
 */
export function zhunBeiFaSunZhiLingSerive(params) {
    return request({
        url: '/apis/satellite/KmxReadyCommand/list',
        method: 'get',
        params: params,
    })
}

/**
 * 获取指令的固定值信息
 */
export function guDingZhiListsSerive(params) {
    return request({
        url: '/apis/satellite/KmxReadyCommand/guDingZhiLists',
        method: 'get',
        params: params,
    })
}
// 查询 已发送 指令参数  /satellite/KmxSentCommandParam

export function chaXunYiFaZhiLingCanShuSerive(params) {
    return request({
        url: `/apis/satellite/KmxSentCommandParam/list`,
        method: 'get',
        params: params,
    })
}

